<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="拼音识字学习平台，通过汉字与拼音对应关系，帮助快速掌握汉字发音和写法。">
    <meta name="keywords" content="拼音识字,汉字拼音,识字学习,拼音练习,汉字学习">
    <title>拼音识字 | 汉字拼音对应学习平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap"
        rel="stylesheet">
    <style>
        :root {
            --primary: #4361ee;
            --secondary: #3a0ca3;
            --accent: #4cc9f0;
            --light: #f8f9fa;
            --dark: #212529;
            --success: #4ade80;
            --warning: #facc15;
            --danger: #f87171;
            --border-radius: 12px;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        /* 字体设置 */
        @font-face {
            font-family: pinyin;
            src: url('/i/pinyin.ttf');
        }

        .pymp3,
        .py {
            font-family: pinyin;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'pinyin', 'Noto Sans SC', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            color: var(--dark);
            min-height: 100vh;
            line-height: 1.6;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* Header Styles */
        header {
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: white;
            padding: 20px 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 10px;
        }

        .logo-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 60px;
            height: 60px;
            background: white;
            border-radius: 50%;
            box-shadow: var(--shadow);
            font-size: 2rem;
            color: var(--primary);
        }

        .logo-text {
            display: flex;
            flex-direction: column;
        }

        .logo h1 {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .logo p {
            font-size: 1rem;
            opacity: 0.9;
        }

        .nav-menu {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .nav-btn {
            padding: 12px 20px;
            background: rgba(255, 255, 255, 0.15);
            font-size: 1rem;
            color: white;
            border: none;
            border-radius: var(--border-radius);
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 5px 0;
            position: relative;
            overflow: hidden;
            text-decoration: none;
        }

        .nav-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(-100%);
            transition: transform 0.3s ease;
        }

        .nav-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
        }

        .nav-btn:hover::before {
            transform: translateX(0);
        }

        .nav-btn.active {
            background: white;
            color: var(--primary);
            box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
        }

        /* Main Content */
        .main-content {
            display: grid;
            grid-template-columns: 1fr;
            gap: 30px;
            padding: 30px 0;
        }

        /* 总进度条样式 */
        .total-progress {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            padding: 20px 25px;
            margin-bottom: 30px;
        }

        .total-progress h3 {
            font-size: 1.3rem;
            color: var(--secondary);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .total-progress h3 i {
            color: var(--accent);
        }

        .progress-container {
            width: 100%;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .progress-bar {
            height: 12px;
            background: #e9ecef;
            border-radius: 10px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(to right, var(--accent), var(--primary));
            border-radius: 10px;
            transition: width 0.5s ease;
        }

        .card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            padding: 25px;
            margin-bottom: 30px;
            transition: var(--transition);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid var(--primary);
        }

        .card-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--secondary);
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .card-title i {
            color: var(--accent);
            font-size: 1.8rem;
        }

        .section-desc {
            text-align: center;
            margin-bottom: 20px;
            padding: 15px;
            background: rgba(67, 97, 238, 0.05);
            border-radius: var(--border-radius);
            font-size: 1.1rem;
        }

        /* 汉字卡片样式 */
        .character-grid {
            display: grid;
            gap: 25px;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        }

        .character-card {
            position: relative;
            background: linear-gradient(145deg, #ffffff, #f0f0f0);
            border-radius: var(--border-radius);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            padding: 30px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.03);
        }

        .character-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--accent), var(--primary));
            transform: scaleX(0);
            transition: transform 0.4s ease;
        }

        .character-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 12px 25px rgba(67, 97, 238, 0.15);
        }

        .character-card:hover::before {
            transform: scaleX(1);
        }

        .character {
            font-size: 5rem;
            font-weight: bold;
            color: var(--dark);
            margin-bottom: 15px;
            transition: all 0.3s ease;
            position: relative;
            display: inline-block;
            line-height: 1;
        }

        .character-card:hover .character {
            color: var(--primary);
            transform: scale(1.1);
        }

        .character-stroke {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .character-card:hover .character-stroke {
            opacity: 0.2;
        }

        .pinyin-notation {
            font-size: 1.3rem;
            color: var(--primary);
            margin-bottom: 10px;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .character-card:hover .pinyin-notation {
            transform: translateY(5px);
        }

        .character-meaning {
            font-size: 1rem;
            color: var(--dark);
            opacity: 0.8;
            padding-top: 10px;
            border-top: 1px dashed rgba(0, 0, 0, 0.1);
        }

        .character-pronounce {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(76, 201, 240, 0.1);
            color: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.3s ease;
            opacity: 0.7;
        }

        .character-card:hover .character-pronounce {
            background: var(--accent);
            color: white;
            transform: scale(1.1);
            opacity: 1;
        }

        .character-level {
            position: absolute;
            top: 15px;
            left: 15px;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.8rem;
            background: rgba(67, 97, 238, 0.1);
            color: var(--primary);
            font-weight: 500;
        }

        /* 汉字详情模态框 */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .modal.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-content {
            background: white;
            border-radius: var(--border-radius);
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
            padding: 30px;
            position: relative;
            transform: translateY(30px) scale(0.95);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .modal.active .modal-content {
            transform: translateY(0) scale(1);
        }

        .modal-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--dark);
            opacity: 0.7;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .modal-close:hover {
            opacity: 1;
            transform: rotate(90deg);
        }

        .modal-header {
            text-align: center;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        .modal-character {
            font-size: 6rem;
            margin-bottom: 15px;
            display: inline-block;
        }

        .modal-pinyin {
            font-size: 1.8rem;
            color: var(--primary);
            margin-bottom: 10px;
        }

        .stroke-order {
            display: flex;
            justify-content: center;
            margin: 25px 0;
        }

        .stroke-container {
            width: 200px;
            height: 200px;
            position: relative;
            background: rgba(0, 0, 0, 0.02);
            border-radius: 8px;
            overflow: hidden;
        }

        .stroke-animation {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .modal-section {
            margin-bottom: 25px;
        }

        .modal-section h4 {
            font-size: 1.3rem;
            color: var(--secondary);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-section h4 i {
            color: var(--accent);
        }

        .example-words {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 10px;
        }

        .example-word {
            padding: 8px 15px;
            background: rgba(67, 97, 238, 0.05);
            border-radius: 6px;
            transition: all 0.3s ease;
        }

        .example-word:hover {
            background: rgba(67, 97, 238, 0.1);
            transform: translateY(-2px);
        }

        .example-word .word {
            font-weight: 500;
            margin-right: 5px;
        }

        .example-word .word-pinyin {
            color: var(--primary);
            font-size: 0.9rem;
            opacity: 0.8;
        }

        /* 分类筛选 */
        .category-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 30px;
            padding: 15px;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
        }

        .filter-btn {
            padding: 8px 20px;
            background: rgba(67, 97, 238, 0.05);
            border: none;
            border-radius: 20px;
            color: var(--dark);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .filter-btn:hover {
            background: rgba(67, 97, 238, 0.1);
        }

        .filter-btn.active {
            background: var(--primary);
            color: white;
        }

        .filter-btn i {
            font-size: 0.9rem;
        }

        /* 学习控制区 */
        .learning-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            flex-wrap: wrap;
            gap: 15px;
        }

        .search-box {
            flex: 1;
            min-width: 250px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 12px 20px 12px 45px;
            border: none;
            border-radius: 30px;
            background: white;
            box-shadow: var(--shadow);
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
            padding-left: 40px;
        }

        .search-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary);
            transition: all 0.3s ease;
        }

        .search-input:focus+.search-icon {
            color: var(--accent);
        }

        .view-controls {
            display: flex;
            gap: 10px;
        }

        .view-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: white;
            border: none;
            box-shadow: var(--shadow);
            color: var(--dark);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .view-btn:hover,
        .view-btn.active {
            background: var(--primary);
            color: white;
        }

        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }

        .info-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            padding: 25px;
        }

        .info-card h3 {
            font-size: 1.4rem;
            color: var(--secondary);
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--primary);
        }

        .info-list {
            list-style: none;
        }

        .info-list li {
            padding: 12px 0;
            border-bottom: 1px solid #eee;
            display: flex;
            align-items: flex-start;
            gap: 10px;
        }

        .info-list li:last-child {
            border-bottom: none;
        }

        .info-list i {
            color: var(--accent);
            margin-top: 4px;
        }

        .quick-links {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .quick-link {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            background: rgba(67, 97, 238, 0.05);
            border-radius: 8px;
            color: var(--dark);
            text-decoration: none;
            transition: var(--transition);
            gap: 10px;
        }

        .quick-link:hover {
            background: rgba(67, 97, 238, 0.1);
            transform: translateX(5px);
        }

        .quick-link i {
            color: var(--primary);
        }

        /* 学习进度 */
        .progress-stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .progress-stat {
            background: rgba(67, 97, 238, 0.05);
            padding: 15px;
            border-radius: var(--border-radius);
            text-align: center;
            transition: all 0.3s ease;
        }

        .progress-stat:hover {
            background: rgba(67, 97, 238, 0.1);
            transform: translateY(-3px);
        }

        .stat-number {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 0.9rem;
            color: var(--dark);
            opacity: 0.8;
        }

        /* Footer */
        footer {
            background: var(--dark);
            color: white;
            padding: 40px 0 20px;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-bottom: 30px;
        }

        .footer-section h4 {
            font-size: 1.2rem;
            margin-bottom: 20px;
            color: var(--accent);
        }

        .footer-links {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .footer-link {
            display: inline-block;
            padding: 8px 15px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: white;
            text-decoration: none;
            transition: var(--transition);
        }

        .footer-link:hover {
            background: var(--primary);
        }

        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.9rem;
            opacity: 0.7;
        }

        /* Audio Player */
        #player {
            display: none;
        }

        /* Animation */
        @keyframes float {
            0% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-10px);
            }

            100% {
                transform: translateX(0px);
            }
        }

        .floating {
            animation: float 3s ease-in-out infinite;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }

            100% {
                transform: scale(1);
            }
        }

        .pulse {
            animation: pulse 2s infinite;
        }

        /* 学习进度提示 */
        .progress-popup {
            position: fixed;
            top: 20px;
            right: 20px;
            background: var(--success);
            color: white;
            padding: 15px 25px;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            z-index: 1000;
            transform: translateX(120%);
            transition: transform 0.5s ease;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .progress-popup.show {
            transform: translateX(0);
        }

        /* 加载动画 */
        .loader {
            display: none;
            justify-content: center;
            padding: 40px 0;
        }

        .loader.active {
            display: flex;
        }

        .loader-dot {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background: var(--primary);
            margin: 0 8px;
            animation: bounce 1.4s infinite ease-in-out both;
        }

        .loader-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .loader-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes bounce {

            0%,
            80%,
            100% {
                transform: scale(0);
            }

            40% {
                transform: scale(1);
            }
        }

        /* Responsive */
        @media (min-width: 768px) {
            .main-content {
                grid-template-columns: 1fr 350px;
            }

            .header-container {
                flex-wrap: nowrap;
            }

            .logo {
                margin-bottom: 0;
            }

            .card-header {
                flex-wrap: nowrap;
            }

            .card-title {
                margin-bottom: 0;
            }
        }

        @media (max-width: 767px) {
            .character {
                font-size: 4rem;
            }

            .modal-character {
                font-size: 4rem;
            }

            .stroke-container {
                width: 150px;
                height: 150px;
            }
        }

        @media (max-width: 479px) {
            .character {
                font-size: 3rem;
            }

            .character-card {
                padding: 20px 15px;
            }

            .modal-content {
                padding: 20px 15px;
            }

            .modal-character {
                font-size: 3rem;
            }

            .modal-pinyin {
                font-size: 1.5rem;
            }
        }
    </style>
</head>

<body>
    <!-- 学习进度提示 -->
    <div class="progress-popup">
        <i class="fas fa-check-circle"></i> <span id="popup-message">已标记为已学习！</span>
    </div>

    <!-- Header -->
    <header>
        <div class="container header-container">
            <div class="logo">
                <div class="logo-icon">
                    <i class="fas fa-language"></i>
                </div>
                <div class="logo-text">
                    <h1>汉语拼音在线学习</h1>
                    <p>标准拼音发音点读工具</p>
                </div>
            </div>
            <div class="nav-menu">
                <a href="/" class="nav-btn"><i class="fas fa-book"></i>学拼音</a>
                <a href="/shengdiao.html" class="nav-btn"><i class="fas fa-music"></i> 读声调</a>
                <a href="/yinjiebiao.html" class="nav-btn"><i class="fas fa-table"></i> 音节表</a>
                <a href="/pinyinshizi.html" class="nav-btn active"><i class="fas fa-font"></i> 拼音识字</a>
                <a href="/" class="nav-btn"><i class="fas fa-ellipsis-h"></i> 更多</a>
            </div>
        </div>
    </header>

    <!-- Main Content -->
    <div class="container">
        <div class="main-content">
            <!-- Main Content Area -->
            <div class="main-area">
                <!-- 总进度条 -->
                <div class="total-progress">
                    <h3><i class="fas fa-chart-line"></i> 识字学习进度</h3>
                    <div class="progress-container">
                        <div class="progress-header">
                            <span>已学习汉字 / 总数量</span>
                            <span id="total-percentage">0/50</span>
                        </div>
                        <div class="progress-bar">
                            <div class="progress-fill" id="total-progress" style="width: 0%"></div>
                        </div>
                    </div>
                </div>

                <!-- 分类筛选 -->
                <div class="category-filter">
                    <button class="filter-btn active" data-category="all">
                        <i class="fas fa-th"></i> 全部汉字
                    </button>
                    <button class="filter-btn" data-category="animal">
                        <i class="fas fa-dog"></i> 动物类
                    </button>
                    <button class="filter-btn" data-category="nature">
                        <i class="fas fa-tree"></i> 自然类
                    </button>
                    <button class="filter-btn" data-category="people">
                        <i class="fas fa-user"></i> 人物类
                    </button>
                    <button class="filter-btn" data-category="food">
                        <i class="fas fa-apple-alt"></i> 食物类
                    </button>
                    <button class="filter-btn" data-category="action">
                        <i class="fas fa-running"></i> 动作类
                    </button>
                </div>

                <!-- 学习控制区 -->
                <div class="learning-controls">
                    <div class="search-box">
                        <input type="text" class="search-input" placeholder="搜索汉字或拼音...">
                        <i class="fas fa-search search-icon"></i>
                    </div>
                    <div class="view-controls">
                        <button class="view-btn active" id="grid-view">
                            <i class="fas fa-th"></i>
                        </button>
                        <button class="view-btn" id="list-view">
                            <i class="fas fa-list"></i>
                        </button>
                    </div>
                </div>

                <!-- 汉字列表 Section -->
                <div class="card">
                    <div class="card-header">
                        <h2 class="card-title">
                            <i class="fas fa-font"></i> 拼音识字学习
                        </h2>
                    </div>

                    <p class="section-desc py">
                        点击汉字卡片查看详情、听发音、学习笔画顺序，掌握汉字与拼音的对应关系。
                    </p>

                    <!-- 加载动画 -->
                    <div class="loader">
                        <div class="loader-dot"></div>
                        <div class="loader-dot"></div>
                        <div class="loader-dot"></div>
                    </div>

                    <div class="character-grid" id="characters-container">
                        <!-- 汉字卡片1 -->
                        <div class="character-card" data-id="1" data-category="people" data-character="人"
                            data-pinyin="rén">
                            <span class="character-level">初级</span>
                            <div class="character">人
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M30,20 Q50,5 70,20 L60,60 Q50,80 40,60 Z" fill="none" stroke="#4361ee"
                                        stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">rén</div>
                            <div class="character-meaning">人类，指能制造工具并使用工具进行劳动的高等动物</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片2 -->
                        <div class="character-card" data-id="2" data-category="nature" data-character="山"
                            data-pinyin="shān">
                            <span class="character-level">初级</span>
                            <div class="character">山
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M50,10 L20,70 L80,70 Z" fill="none" stroke="#4361ee" stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">shān</div>
                            <div class="character-meaning">地面上由土石构成的高耸部分</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片3 -->
                        <div class="character-card" data-id="3" data-category="animal" data-character="马"
                            data-pinyin="mǎ">
                            <span class="character-level">初级</span>
                            <div class="character">马
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M20,80 Q40,20 80,30 L90,70 Q60,90 30,70 Z" fill="none" stroke="#4361ee"
                                        stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">mǎ</div>
                            <div class="character-meaning">一种哺乳动物，善跑，可供人骑或拉东西</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片4 -->
                        <div class="character-card" data-id="4" data-category="food" data-character="米"
                            data-pinyin="mǐ">
                            <span class="character-level">初级</span>
                            <div class="character">米
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M30,30 L70,70 M30,70 L70,30 M50,20 L50,80 M20,50 L80,50" fill="none"
                                        stroke="#4361ee" stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">mǐ</div>
                            <div class="character-meaning">谷类或其他植物去壳后的子实</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片5 -->
                        <div class="character-card" data-id="5" data-category="action" data-character="走"
                            data-pinyin="zǒu">
                            <span class="character-level">中级</span>
                            <div class="character">走
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M30,80 Q40,40 60,60 L70,90" fill="none" stroke="#4361ee"
                                        stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">zǒu</div>
                            <div class="character-meaning">人或鸟兽的脚交互向前移动</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片6 -->
                        <div class="character-card" data-id="6" data-category="nature" data-character="水"
                            data-pinyin="shuǐ">
                            <span class="character-level">初级</span>
                            <div class="character">水
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M30,20 C40,40 60,30 70,50 C50,60 40,80 60,90" fill="none" stroke="#4361ee"
                                        stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">shuǐ</div>
                            <div class="character-meaning">一种无色、无味、透明的液体</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片7 -->
                        <div class="character-card" data-id="7" data-category="animal" data-character="鸟"
                            data-pinyin="niǎo">
                            <span class="character-level">中级</span>
                            <div class="character">鸟
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M70,30 L30,50 Q20,70 40,80 L60,70 Q80,60 70,30" fill="none"
                                        stroke="#4361ee" stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">niǎo</div>
                            <div class="character-meaning">脊椎动物的一类，温血卵生，用肺呼吸</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>

                        <!-- 汉字卡片8 -->
                        <div class="character-card" data-id="8" data-category="food" data-character="果"
                            data-pinyin="guǒ">
                            <span class="character-level">中级</span>
                            <div class="character">果
                                <svg class="character-stroke" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <path
                                        d="M50,20 Q70,40 70,70 Q50,90 30,70 Q30,40 50,20 M50,40 Q60,50 50,60 Q40,50 50,40"
                                        fill="none" stroke="#4361ee" stroke-width="2" />
                                </svg>
                            </div>
                            <div class="pinyin-notation">guǒ</div>
                            <div class="character-meaning">某些植物花落后含有种子的部分</div>
                            <div class="character-pronounce">
                                <i class="fas fa-volume-up"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Sidebar -->
            <div class="sidebar">
                <div class="info-card">
                    <h3><i class="fas fa-chart-pie"></i> 学习统计</h3>
                    <div class="progress-stats">
                        <div class="progress-stat">
                            <div class="stat-number" id="learned-count">0</div>
                            <div class="stat-label">已学汉字</div>
                        </div>
                        <div class="progress-stat">
                            <div class="stat-number" id="total-count">50</div>
                            <div class="stat-label">总汉字数</div>
                        </div>
                        <div class="progress-stat">
                            <div class="stat-number" id="accuracy-rate">0%</div>
                            <div class="stat-label">正确率</div>
                        </div>
                        <div class="progress-stat">
                            <div class="stat-number" id="study-days">0</div>
                            <div class="stat-label">学习天数</div>
                        </div>
                    </div>
                    <div class="progress-container">
                        <div class="progress-header">
                            <span>掌握程度</span>
                            <span id="mastery-percentage">0%</span>
                        </div>
                        <div class="progress-bar">
                            <div class="progress-fill" id="mastery-progress" style="width: 0%"></div>
                        </div>
                    </div>
                </div>

                <div class="info-card">
                    <h3><i class="fas fa-info-circle"></i> 学习指南</h3>
                    <ul class="info-list">
                        <li>
                            <i class="fas fa-check-circle"></i>
                            <div>点击汉字卡片可查看详细信息和笔画动画</div>
                        </li>
                        <li>
                            <i class="fas fa-check-circle"></i>
                            <div>点击发音按钮听取标准拼音读音</div>
                        </li>
                        <li>
                            <i class="fas fa-check-circle"></i>
                            <div>可按类别筛选汉字，针对性学习</div>
                        </li>
                        <li>
                            <i class="fas fa-check-circle"></i>
                            <div>完成学习后可标记为已掌握，系统自动记录</div>
                        </li>
                    </ul>
                </div>

                <div class="info-card">
                    <h3><i class="fas fa-lightbulb"></i> 学习技巧</h3>
                    <ul class="info-list">
                        <li>
                            <i class="fas fa-star"></i>
                            <div>先掌握汉字的拼音发音，再学习书写</div>
                        </li>
                        <li>
                            <i class="fas fa-star"></i>
                            <div>通过组词加深对汉字含义的理解</div>
                        </li>
                        <li>
                            <i class="fas fa-star"></i>
                            <div>每天学习5-10个汉字，反复练习巩固</div>
                        </li>
                        <li>
                            <i class="fas fa-star"></i>
                            <div>注意观察汉字结构，掌握笔画顺序</div>
                        </li>
                    </ul>
                </div>

                <div class="info-card">
                    <h3><i class="fas fa-link"></i> 快速导航</h3>
                    <div class="quick-links">
                        <a href="#" class="quick-link">
                            <i class="fas fa-book-open"></i>
                            <span>初级汉字</span>
                        </a>
                        <a href="#" class="quick-link">
                            <i class="fas fa-book-open"></i>
                            <span>中级汉字</span>
                        </a>
                        <a href="#" class="quick-link">
                            <i class="fas fa-redo"></i>
                            <span>复习已学</span>
                        </a>
                        <a href="#" class="quick-link">
                            <i class="fas fa-check-square"></i>
                            <span>汉字测试</span>
                        </a>
                        <a href="#" class="quick-link">
                            <i class="fas fa-magic"></i>
                            <span>汉字游戏</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 汉字详情模态框 -->
    <div class="modal" id="character-modal">
        <div class="modal-content">
            <button class="modal-close" id="modal-close">
                <i class="fas fa-times"></i>
            </button>
            <div class="modal-header">
                <div class="modal-character" id="modal-char">人</div>
                <div class="modal-pinyin" id="modal-pinyin">rén</div>
                <div class="modal-meaning" id="modal-meaning">人类，指能制造工具并使用工具进行劳动的高等动物</div>
            </div>

            <div class="modal-section">
                <h4><i class="fas fa-pen-fancy"></i> 笔画顺序</h4>
                <div class="stroke-order">
                    <div class="stroke-container">
                        <img src="/i/strokes/ren.gif" alt="笔画顺序" class="stroke-animation" id="stroke-animation">
                    </div>
                </div>
                <div class="stroke-info" id="stroke-info">
                    <strong>笔画数：</strong><span id="stroke-count">2</span> 画
                    <br>
                    <strong>结构：</strong><span id="character-structure">独体字</span>
                </div>
            </div>

            <div class="modal-section">
                <h4><i class="fas fa-volume-up"></i> 发音练习</h4>
                <p>点击下方按钮听取标准发音，并跟读练习</p>
                <button class="filter-btn active" id="pronounce-btn" style="margin-top: 10px;">
                    <i class="fas fa-play"></i> 播放发音
                </button>
            </div>

            <div class="modal-section">
                <h4><i class="fas fa-synagogue"></i> 组词示例</h4>
                <div class="example-words" id="example-words">
                    <div class="example-word">
                        <span class="word">人民</span>
                        <span class="word-pinyin">rén mín</span>
                    </div>
                    <div class="example-word">
                        <span class="word">人类</span>
                        <span class="word-pinyin">rén lèi</span>
                    </div>
                    <div class="example-word">
                        <span class="word">工人</span>
                        <span class="word-pinyin">gōng rén</span>
                    </div>
                    <div class="example-word">
                        <span class="word">大人</span>
                        <span class="word-pinyin">dà rén</span>
                    </div>
                </div>
            </div>

            <div class="modal-section">
                <h4><i class="fas fa-check-circle"></i> 学习状态</h4>
                <button class="filter-btn active" id="mark-learned" style="width: 100%;">
                    <i class="fas fa-check"></i> 标记为已学习
                </button>
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-section">
                    <h4>学习资源</h4>
                    <div class="footer-links">
                        <a href="#" class="footer-link">拼音字母表</a>
                        <a href="#" class="footer-link">声母学习</a>
                        <a href="#" class="footer-link">韵母学习</a>
                        <a href="#" class="footer-link">声调练习</a>
                        <a href="shizitianpinyin.html" class="footer-link">识字填拼音</a>
                        <a href="pinyinshizi.html" class="footer-link">拼音识字</a>
                        <a href="pinyinshiciyu.html" class="footer-link">拼音识词语</a>
                        <a href="yinianji.html" class="footer-link">拼音错题本</a>
                        <a href="yinianji.html" class="footer-link">小学一年级</a>
                        <a href="ernianji.html" class="footer-link">小学二年级</a>
                    </div>
                </div>

                <div class="footer-section">
                    <h4>实用工具</h4>
                    <div class="footer-links">
                        <a href="diandu.html" class="footer-link">拼音点读</a>
                        <a href="pinyinceshi.html" class="footer-link">拼音测试</a>
                        <a href="pinyinyouxi.html" class="footer-link">拼音游戏</a>
                        <a href="hanzipinyin.html" class="footer-link">汉字转拼音</a>
                    </div>
                </div>

                <div class="footer-section">
                    <h4>友情链接</h4>
                    <div class="footer-links">
                        <a href="https://www.hanyupinyin.net" class="footer-link" target="_blank">汉语拼音官网</a>
                        <a href="https://youquhome.com/" class="footer-link" target="_blank">有趣网址之家</a>
                        <a href="https://www.bjtime.net/" class="footer-link" target="_blank">北京时间</a>
                        <a href="https://www.schulte.top/" class="footer-link" target="_blank">注意力训练游戏</a>
                        <a href="https://www.zitie123.cn/" class="footer-link" target="_blank">字帖训练</a>
                    </div>
                </div>
            </div>

            <div class="copyright">
                © 2023 HanYuPinYin.Net 汉语拼音在线学习平台 | 让汉语学习更简单
            </div>
        </div>
    </footer>

    <!-- Audio Player -->
    <audio id="player">
        您的浏览器不支持HTML5音频播放，请使用现代浏览器访问
    </audio>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 初始化变量
            const player = document.getElementById('player');
            const burl = '/i/pinyinmp3/';
            const progressPopup = document.querySelector('.progress-popup');
            const popupMessage = document.getElementById('popup-message');
            const modal = document.getElementById('character-modal');
            const modalClose = document.getElementById('modal-close');
            const charactersContainer = document.getElementById('characters-container');
            const characterCards = document.querySelectorAll('.character-card');
            const filterButtons = document.querySelectorAll('.filter-btn');
            const searchInput = document.querySelector('.search-input');
            const gridViewBtn = document.getElementById('grid-view');
            const listViewBtn = document.getElementById('list-view');
            const loader = document.querySelector('.loader');

            // 当前选中的汉字ID
            let currentCharacterId = null;

            // 学习状态数据
            let studyData = {
                learnedCharacters: [],
                accuracy: 0,
                studyDays: 0,
                lastStudyDate: null
            };

            // 汉字详细数据
            const charactersData = {
                1: {
                    character: "人",
                    pinyin: "rén",
                    meaning: "人类，指能制造工具并使用工具进行劳动的高等动物",
                    strokes: 2,
                    structure: "独体字",
                    strokeImage: "/i/strokes/ren.gif",
                    examples: [
                        { word: "人民", pinyin: "rén mín" },
                        { word: "人类", pinyin: "rén lèi" },
                        { word: "工人", pinyin: "gōng rén" },
                        { word: "大人", pinyin: "dà rén" }
                    ],
                    audio: "ren2.mp3"
                },
                2: {
                    character: "山",
                    pinyin: "shān",
                    meaning: "地面上由土石构成的高耸部分",
                    strokes: 3,
                    structure: "独体字",
                    strokeImage: "/i/strokes/shan.gif",
                    examples: [
                        { word: "山水", pinyin: "shān shuǐ" },
                        { word: "高山", pinyin: "gāo shān" },
                        { word: "山峰", pinyin: "shān fēng" },
                        { word: "山路", pinyin: "shān lù" }
                    ],
                    audio: "shan1.mp3"
                },
                3: {
                    character: "马",
                    pinyin: "mǎ",
                    meaning: "一种哺乳动物，善跑，可供人骑或拉东西",
                    strokes: 3,
                    structure: "独体字",
                    strokeImage: "/i/strokes/ma.gif",
                    examples: [
                        { word: "马车", pinyin: "mǎ chē" },
                        { word: "马上", pinyin: "mǎ shàng" },
                        { word: "骑马", pinyin: "qí mǎ" },
                        { word: "木马", pinyin: "mù mǎ" }
                    ],
                    audio: "ma3.mp3"
                },
                4: {
                    character: "米",
                    pinyin: "mǐ",
                    meaning: "谷类或其他植物去壳后的子实",
                    strokes: 6,
                    structure: "独体字",
                    strokeImage: "/i/strokes/mi.gif",
                    examples: [
                        { word: "米饭", pinyin: "mǐ fàn" },
                        { word: "大米", pinyin: "dà mǐ" },
                        { word: "小米", pinyin: "xiǎo mǐ" },
                        { word: "米粒", pinyin: "mǐ lì" }
                    ],
                    audio: "mi3.mp3"
                },
                5: {
                    character: "走",
                    pinyin: "zǒu",
                    meaning: "人或鸟兽的脚交互向前移动",
                    strokes: 7,
                    structure: "半包围结构",
                    strokeImage: "/i/strokes/zou.gif",
                    examples: [
                        { word: "走路", pinyin: "zǒu lù" },
                        { word: "走开", pinyin: "zǒu kāi" },
                        { word: "行走", pinyin: "xíng zǒu" },
                        { word: "出走", pinyin: "chū zǒu" }
                    ],
                    audio: "zou3.mp3"
                },
                6: {
                    character: "水",
                    pinyin: "shuǐ",
                    meaning: "一种无色、无味、透明的液体",
                    strokes: 4,
                    structure: "独体字",
                    strokeImage: "/i/strokes/shui.gif",
                    examples: [
                        { word: "水果", pinyin: "shuǐ guǒ" },
                        { word: "开水", pinyin: "kāi shuǐ" },
                        { word: "水平", pinyin: "shuǐ píng" },
                        { word: "山水", pinyin: "shān shuǐ" }
                    ],
                    audio: "shui3.mp3"
                },
                7: {
                    character: "鸟",
                    pinyin: "niǎo",
                    meaning: "脊椎动物的一类，温血卵生，用肺呼吸",
                    strokes: 5,
                    structure: "独体字",
                    strokeImage: "/i/strokes/niao.gif",
                    examples: [
                        { word: "小鸟", pinyin: "xiǎo niǎo" },
                        { word: "飞鸟", pinyin: "fēi niǎo" },
                        { word: "鸟类", pinyin: "niǎo lèi" },
                        { word: "鸟蛋", pinyin: "niǎo dàn" }
                    ],
                    audio: "niao3.mp3"
                },
                8: {
                    character: "果",
                    pinyin: "guǒ",
                    meaning: "某些植物花落后含有种子的部分",
                    strokes: 8,
                    structure: "独体字",
                    strokeImage: "/i/strokes/guo.gif",
                    examples: [
                        { word: "水果", pinyin: "shuǐ guǒ" },
                        { word: "果实", pinyin: "guǒ shí" },
                        { word: "苹果", pinyin: "píng guǒ" },
                        { word: "结果", pinyin: "jié guǒ" }
                    ],
                    audio: "guo3.mp3"
                }
            };

            // 从localStorage加载学习数据
            function loadStudyData() {
                const savedData = localStorage.getItem('characterStudyData');
                if (savedData) {
                    studyData = JSON.parse(savedData);
                } else {
                    // 初始化学习数据
                    saveStudyData();
                }

                // 更新学习天数
                updateStudyDays();

                // 更新UI
                updateLearningProgress();
                markLearnedCards();
            }

            // 保存学习数据到localStorage
            function saveStudyData() {
                localStorage.setItem('characterStudyData', JSON.stringify(studyData));
            }

            // 更新学习天数
            function updateStudyDays() {
                const today = new Date().toDateString();

                // 如果是第一次学习或今天还未学习过
                if (!studyData.lastStudyDate || studyData.lastStudyDate !== today) {
                    studyData.studyDays++;
                    studyData.lastStudyDate = today;
                    saveStudyData();
                }

                // 更新UI
                document.getElementById('study-days').textContent = studyData.studyDays;
            }

            // 显示进度更新提示
            function showProgressPopup(message) {
                popupMessage.textContent = message;
                progressPopup.classList.add('show');
                setTimeout(() => {
                    progressPopup.classList.remove('show');
                }, 2000);
            }

            // 获取总汉字数量
            function getTotalCharactersCount() {
                return characterCards.length;
            }

            // 获取已学习汉字数量
            function getLearnedCharactersCount() {
                return studyData.learnedCharacters.length;
            }

            // 更新学习进度
            function updateLearningProgress() {
                const totalCount = getTotalCharactersCount();
                const learnedCount = getLearnedCharactersCount();
                const percentage = Math.round((learnedCount / totalCount) * 100);

                // 更新进度条和文本
                document.getElementById('total-progress').style.width = `${percentage}%`;
                document.getElementById('total-percentage').textContent = `${learnedCount}/${totalCount}`;
                document.getElementById('mastery-progress').style.width = `${percentage}%`;
                document.getElementById('mastery-percentage').textContent = `${percentage}%`;
                document.getElementById('learned-count').textContent = learnedCount;
                document.getElementById('total-count').textContent = totalCount;
                document.getElementById('accuracy-rate').textContent = `${studyData.accuracy}%`;
            }

            // 标记已学习的卡片
            function markLearnedCards() {
                characterCards.forEach(card => {
                    const charId = parseInt(card.dataset.id);
                    if (studyData.learnedCharacters.includes(charId)) {
                        card.classList.add('learned');
                    } else {
                        card.classList.remove('learned');
                    }
                });
            }

            // 打开汉字详情模态框
            function openCharacterModal(charId) {
                currentCharacterId = charId;
                const charData = charactersData[charId];

                if (!charData) return;

                // 填充模态框数据
                document.getElementById('modal-char').textContent = charData.character;
                document.getElementById('modal-pinyin').textContent = charData.pinyin;
                document.getElementById('modal-meaning').textContent = charData.meaning;
                document.getElementById('stroke-count').textContent = charData.strokes;
                document.getElementById('character-structure').textContent = charData.structure;
                document.getElementById('stroke-animation').src = charData.strokeImage;

                // 更新组词示例
                const examplesContainer = document.getElementById('example-words');
                examplesContainer.innerHTML = '';

                charData.examples.forEach(example => {
                    const exampleElement = document.createElement('div');
                    exampleElement.className = 'example-word';
                    exampleElement.innerHTML = `
                        <span class="word">${example.word}</span>
                        <span class="word-pinyin">${example.pinyin}</span>
                    `;
                    examplesContainer.appendChild(exampleElement);
                });

                // 更新标记按钮状态
                const markButton = document.getElementById('mark-learned');
                if (studyData.learnedCharacters.includes(charId)) {
                    markButton.innerHTML = '<i class="fas fa-times"></i> 取消已学习';
                    markButton.classList.remove('active');
                } else {
                    markButton.innerHTML = '<i class="fas fa-check"></i> 标记为已学习';
                    markButton.classList.add('active');
                }

                // 显示模态框
                modal.classList.add('active');
                document.body.style.overflow = 'hidden';
            }

            // 关闭汉字详情模态框
            function closeCharacterModal() {
                modal.classList.remove('active');
                document.body.style.overflow = '';
                currentCharacterId = null;
            }

            // 播放汉字发音
            function playCharacterPronunciation(charId) {
                const charData = charactersData[charId];
                if (charData && charData.audio) {
                    player.src = burl + charData.audio;
                    player.play();

                    // 添加播放动画
                    const pronounceBtn = document.getElementById('pronounce-btn');
                    pronounceBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 播放中...';

                    player.onended = function () {
                        pronounceBtn.innerHTML = '<i class="fas fa-play"></i> 播放发音';
                    };
                }
            }

            // 标记或取消标记汉字为已学习
            function toggleLearnedStatus(charId) {
                const index = studyData.learnedCharacters.indexOf(charId);

                if (index === -1) {
                    // 标记为已学习
                    studyData.learnedCharacters.push(charId);
                    showProgressPopup(`已将"${charactersData[charId].character}"标记为已学习！`);
                } else {
                    // 取消已学习标记
                    studyData.learnedCharacters.splice(index, 1);
                    showProgressPopup(`已取消"${charactersData[charId].character}"的已学习标记！`);
                }

                // 保存数据并更新UI
                saveStudyData();
                updateLearningProgress();
                markLearnedCards();

                // 更新标记按钮状态
                const markButton = document.getElementById('mark-learned');
                if (studyData.learnedCharacters.includes(charId)) {
                    markButton.innerHTML = '<i class="fas fa-times"></i> 取消已学习';
                    markButton.classList.remove('active');
                } else {
                    markButton.innerHTML = '<i class="fas fa-check"></i> 标记为已学习';
                    markButton.classList.add('active');
                }
            }

            // 筛选汉字卡片
            function filterCharacters(category) {
                characterCards.forEach(card => {
                    if (category === 'all' || card.dataset.category === category) {
                        card.style.display = 'block';
                        // 添加淡入动画
                        setTimeout(() => {
                            card.style.opacity = '1';
                            card.style.transform = 'scale(1)';
                        }, 50);
                    } else {
                        // 添加淡出动画
                        card.style.opacity = '0';
                        card.style.transform = 'scale(0.8)';
                        setTimeout(() => {
                            card.style.display = 'none';
                        }, 300);
                    }
                });
            }

            // 搜索汉字或拼音
            function searchCharacters(query) {
                if (!query) {
                    // 如果搜索为空，显示所有卡片
                    characterCards.forEach(card => {
                        card.style.display = 'block';
                        card.style.opacity = '1';
                        card.style.transform = 'scale(1)';
                    });
                    return;
                }

                query = query.toLowerCase();

                characterCards.forEach(card => {
                    const character = card.dataset.character.toLowerCase();
                    const pinyin = card.dataset.pinyin.toLowerCase();

                    if (character.includes(query) || pinyin.includes(query)) {
                        card.style.display = 'block';
                        setTimeout(() => {
                            card.style.opacity = '1';
                            card.style.transform = 'scale(1)';
                        }, 50);
                    } else {
                        card.style.opacity = '0';
                        card.style.transform = 'scale(0.8)';
                        setTimeout(() => {
                            card.style.display = 'none';
                        }, 300);
                    }
                });
            }

            // 切换视图模式
            function toggleViewMode(mode) {
                if (mode === 'grid') {
                    charactersContainer.classList.add('character-grid');
                    charactersContainer.classList.remove('character-list');
                    grid
                } else if (mode === 'list') {
                    charactersContainer.classList.remove('character-grid');
                    charactersContainer.classList.add('character-list');
                }
            }

            // 显示学习进度弹窗
            function showProgressPopup(message) {
                const popup = document.getElementById('progress-popup');
                const popupMessage = document.getElementById('progress-popup-message');
                popupMessage.textContent = message;
                popup.style.display = 'block';

                setTimeout(() => {
                    popup.style.display = 'none';
                }, 3000);
            }

            // 保存学习数据
            function saveStudyData() {

                localStorage.setItem('studyData', JSON.stringify(studyData));
            }

            // 标记已学习的卡片
            function markLearnedCards() {
                characterCards.forEach(card => {
                    const charId = card.dataset.id;
                    if (studyData.learnedCharacters.includes(charId)) {
                        card.classList.add('learned');
                    } else {
                        card.classList.remove('learned');
                    }
                });
            }
        });
    </script>
</body>

</html>